/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 artifact_prop_skill.h

	$Header: /heroes4/artifact_prop_skill.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( ARTIFACT_PROP_SKILL_H_INCLUDED )
#define ARTIFACT_PROP_SKILL_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "artifact_prop_effect.h"

namespace t_artifact_prop
{
	// ----------------------------------------------------------------------
	// class for effects which affect a skill
	// ----------------------------------------------------------------------
	class t_skill_effect : public t_artifact_effect
	{
	public:
		void init( t_skill_type skill, int amount = 0 );

		virtual bool accept( t_artifact_effect_visitor& visitor );
		t_skill_type get_skill() const;
		virtual bool read( std::streambuf& buffer );
		void         set_skill( t_skill_type skill );
		virtual bool write( std::streambuf& buffer ) const;
	protected:
		t_skill_type m_skill;
	};

	inline void t_skill_effect::init( t_skill_type skill, int amount )
	{
		m_skill = skill;
		m_amount = amount;
	}

	inline t_skill_type t_skill_effect::get_skill() const
	{
		return m_skill;
	}

	inline void t_skill_effect::set_skill( t_skill_type skill )
	{
		m_skill = skill;
	}

	typedef t_effect< t_skill_effect, k_artifact_effect_skill >			t_skill_percentage;
	typedef t_effect< t_skill_effect, k_artifact_effect_skill_bonus >	t_skill_bonus;

	inline t_skill_percentage* get_skill_percentage( t_skill_type skill, int percentage )
	{
		return new t_skill_percentage( skill, percentage );
	}
};

#endif // ARTIFACT_PROP_SKILL_H_INCLUDED